package com.saint.utils
{
	
	/**
	 * Basic Logger Class
	 *
	 * @author ... kembera
	 */
	public class Logger
	{
		private static var logLevel:uint;
		
		public static const INFO:uint = 0;
		
		public static const DEBUG:uint = 2;
		
		public static const ERROR:uint = 4;
		
		public static const CRITICAL:uint = 6;
		
		public static const STEALTH_MODE:uint = 99;
		
		
		public function Logger()
		{
			trace("Logger - not alot going on here")
		}
		
		public static function setLogLevel(level:uint):void
		{
			logLevel = level;
			trace("Logger.setLogLevel: " + Logger.logLevelToString());
		}
		
		/**
		 * INFO
		 * @param	message
		 */
		public static function info(message:String):void
		{
			if (logLevel <= Logger.INFO)
			{
				trace("::info : " + message);
			}
		}
		
		/**
		 * DEBUG
		 * @param	message
		 */
		public static function debug(message:String):void
		{
			if (logLevel <= Logger.DEBUG)
			{
				trace("::debug : " + message);
			}
		}
		
		/**
		 * ERROR
		 * @param	message
		 */
		public static function error(message:String):void
		{
			if (logLevel <= Logger.ERROR)
			{
				trace("::error: ** " + message);
			}
		}

				
		/**
		 * CRITICAL
		 * @param	message
		 */
		public static function critical(message:String):void
		{
			if (logLevel <= Logger.CRITICAL)
			{
				trace("::critical: ****" + message);
			}
		}
		
		public static function  logLevelToString():String
		{
			var logString:String;
			switch (logLevel)
			{
				case 0:
					logString = "INFO";
				break;
				case 2:
					logString = "DEBUG";
				break;
				case 4:
					logString = "ERROR";
				break;
				case 6:
					logString = "CRITICAL";
				break;
			}
			
			return logString;
		}
		
		
	}

}